// Update the "Status: Saving..." info.
import toc from '@/plugins/toc'
export default (editor, vue) => {
  const pendingActions = editor.plugins.get('PendingActions')

  pendingActions.on('change:hasAny', (evt, propertyName, newValue) => {
    const title = vue.$store.state.selectedDoc.title || ' '
    if (newValue && !editor.firstTime) {
      toc()
      vue.$store.commit('PUSH_MSG', title + '        正在同步中🏃‍    ')
    }
  })
}
